<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h3> 找到1到100中丢失的数字</h3>

    <script>
        function find(arr) {
            let arr1 = new Array(100);
            for (let i = 1; i <= arr1.length; i++) {
                arr1[i - 1] = i;
            }

            let m = 0


            for (i = 0; i < arr.length; i++) {
                for (m = 0; m < arr1.length; m++) {
                    if (arr[i] === arr1[m]) {
                        arr1.splice(m, 1)

                    }

                }
                m = m - 1;
            }
            console.log(arr1);
        }

        let arr = [1, 5, 2, 10, 8, 4, 50, 100, 49];

        find(arr);
    </script>

</body>

</html>